using System;
using OpenFlashChartLib.Json;

namespace OpenFlashChartLib.Charts
{
    public class HBarValue : ILabelValue
    {
        public HBarValue()
        {
        }

        public HBarValue(double left, double right)
        {
            Left = left;
            Right = right;
        }

        [JsonProperty("left")]
        public double Left { get; set; }

        [JsonProperty("right")]
        public double Right { get; set; }

        [JsonIgnore]
        public string Label { get; set; }

        [JsonIgnore]
        public double Value
        {
            get { return Right - Left; }
            set { Right = Left + value; }
        }
    }
}